/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package threads;

/**
 *
 * @author Bertil
 */
public class Producent implements Runnable{
    public Thread activity = new Thread(this); //gör objektet till en tråd
    private String text;
    private long interval;
    private XSimpleQueue q;

    public Producent(String txt, long time, XSimpleQueue k){
        text = txt;
        interval = time*1000;
        q = k;
    }
    public void run(){
        while(XThread.delay(interval)){
            q.put(text);
        }
    }
}
